import 'package:frontend/models/address.dart';
import 'package:json_annotation/json_annotation.dart';

part 'order.g.dart';
@JsonSerializable(explicitToJson: true)
class Order{
  String buyer_name;
  int buyer_id;
  String seller_name;
  int seller_id;
  String good_name;
  int good_id;
  String time_stamp; // 后端可能需要记录购买时间
  Address address;


  Order(this.buyer_name, this.buyer_id, this.seller_name, this.seller_id,
      this.good_name, this.good_id, this.time_stamp, this.address);

  factory Order.fromJson(Map<String, dynamic> json) =>
      _$OrderFromJson(json);

  Map<String, dynamic> toJson() => _$OrderToJson(this);
}